package com.lh.spring.ioc;


import static com.lh.spring.ioc.ApplicationClass.enumToCase;

/**
 * @Description Bean的描述信息类,该类定义的需要被spring-ioc容器管理的对象的信息
 * @Version 1.0.0
 * @Date 2024/1/14 14:30
 * @Created by LiuHua
 * @Path com.lh.spring.ioc
 */
public class BeanDefinition {

    public BeanDefinition(Class clazz, String beanName) {
        this.clazz = clazz;
        //首字母小写
        BeanName = enumToCase.myBeanName(beanName);
    }

    public BeanDefinition(Class clazz, String beanName, long id) {
        this.clazz = clazz;
        BeanName = beanName;
        this.id = id;
    }
    /**
     * 字节码对象
     */
    private Class clazz;

    /**
     * bean的名字,默认是首字母小写的类名
     */
    private String BeanName;
    /**
     * bean的唯一标识,默认采用雪花
     */
    private long id;

    public Class getClazz() {
        return clazz;
    }

    public void setClazz(Class clazz) {
        this.clazz = clazz;
    }

    public String getBeanName() {
        return BeanName;
    }

    public void setBeanName(String beanName) {
        BeanName = beanName;
    }

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }
}
